#pragma once
#include <afxwin.h>
#include "afxtempl.h"
#include "dxflib/dl_dxf.h"
#include "dxflib/dl_creationadapter.h"
#include "DxfLineVector.h"

// CDxfViewer

class CDxfLineEditor : public CStatic
{
	DECLARE_DYNAMIC(CDxfLineEditor)

public:
	CDxfLineEditor();
	virtual ~CDxfLineEditor();

protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnPaint();
    afx_msg BOOL OnEraseBkgnd(CDC* pDC);

public:
    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
protected:
    virtual void PreSubclassWindow();
public:
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg UINT OnGetDlgCode();
    
    const DxfImage& DxfLines() const;
    void DxfLines(const DxfImage& val);

private:
    bool IsPointInLine( CPoint point, DxfLine& line );

private:
    DxfImage m_vLines;
    DxfImage::iterator m_hitPos;
};


